#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,r[N],cl[N],mdg[N],ans,maxx;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n;
    for(int i=0;i<n;i++)
    {
        cin>>r[i];
        mdg[r[i]]++;
        cl[r[i]]++;
        maxx=max(maxx,r[i]);
    }
    for(int i=0;i<maxx;i++)
    {
        for(int j=r[i]+1;j<=maxx;j++)
        {
            if(mdg[j]>0)
            {
                if(mdg[j]<=cl[r[i]])
                {
                    cl[r[i]]-=mdg[j];
                    ans-=mdg[j];
                    mdg[j]=0;
                }
                else
                {
                    mdg[j]-=cl[r[i]];
                    ans-=cl[r[i]];
                    cl[r[i]]=0;
                }
                break;
            }
        }
    }
    cout<<ans;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
